package com.rstrulak.dao;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.rstrulak.core.dao.GenericDaoImpl;
import com.rstrulak.model.Project;
import com.rstrulak.model.ProjectAttachments;

@Repository("projectAttachmentsDao")
public class ProjectAttachmentsDaoImpl extends GenericDaoImpl<ProjectAttachments, Long> implements ProjectAttachmentsDao {

	@Override
	public List<ProjectAttachments> getProjectAttachemntsListByProject(Project project) {
		DetachedCriteria criteria = createDetachedCriteria();
		criteria.add(Restrictions.eq("project", project));
		return getListByCriteria(criteria);
	}

}
